#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <ftpprotstr.h>
#include <string_ex.h>

void
str_split(const char *str,char *left,char *right,char c)
{
	str_seg_elem *pstrlist = str_segment_character_fast(c,LEFT,str);
	//如果链表首元素的word_seg为NULL，那么表示字符串没有被分割
	if(NULL == pstrlist->word_seg) {
		strcpy(left,str);
	} else {
		strcpy(left,pstrlist->word_seg);
		str_seg_elem *pnext = pstrlist->node;
		strcpy(right,pnext->word_seg);
	}
	str_segment_character_list_destroy(pstrlist);
}

void
str_upper(char *str)
{
	while(*str) {
		*str = toupper(*str);
		str++;
	}
}

